-- GENERATED SPELL FOR [Onslaught Commander Iustus] --


function spell0_27334(pUnit, Event) --@Bloodthirst,n/a--
pUnit:FullCastSpellOnTarget(35949,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_27334', 0, 1)
end

function spell1_27334(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(48281,pUnit)
pUnit:RegisterEvent('Sorts_27334', 3319, 1)
end

function spell2_27334(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(48280,pUnit)
pUnit:RegisterEvent('Sorts_27334', 2000, 1)
end

function Sorts_27334(pUnit, Event)
local choix_sorts_27334 = math.random(0, 2)
if choix_sorts_27334 == 0 then
pUnit:RegisterEvent('spell0_27334', 1, 1)
end
if choix_sorts_27334 == 1 then
pUnit:RegisterEvent('spell1_27334', 1, 1)
end
if choix_sorts_27334 == 2 then
pUnit:RegisterEvent('spell2_27334', 1, 1)
end
end

function mob27334_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_27334', math.random(1500, 3000), 1)
end

function mob27334_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27334_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27334_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(27334, 1, 'mob27334_Action')
RegisterUnitEvent(27334, 2, 'mob27334_Leave')
RegisterUnitEvent(27334, 3, 'mob27334_Kill')
RegisterUnitEvent(27334, 4, 'mob27334_Die')
